/**
 * 
 */
package view;

import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

import common.GridCoordinate;
import controller.Controller;

/**
 * @author Bill
 *
 */
public class GridPanel extends ImagePanel implements MouseListener{

	private static final long serialVersionUID = 1L;
	private GridCoordinate gridPosition;

	public GridPanel(String fileName, GridCoordinate coordinate){
		super(fileName);
		gridPosition = coordinate;
		addMouseListener(this);
	}
	
	public GridCoordinate getGridPosition() {
		return gridPosition;
	}

	public void setGridPosition(GridCoordinate gridPosition) {
		this.gridPosition = gridPosition;
	}
	
	/**
	 * Mouse click is handled in the controller class.
	 */
	@Override
	public void mouseClicked(MouseEvent e){
		
	}

	@Override
	public void mouseEntered(MouseEvent e) {
		Controller.hoverOverTile(gridPosition);
	}

	@Override
	public void mouseExited(MouseEvent e) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void mousePressed(MouseEvent e) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void mouseReleased(MouseEvent e) {
		Controller.tileClicked(gridPosition);
	}

}
